package com.example.demo.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.JoinMeeting;
import com.example.demo.mapper.JoinMeetingMapper;
import com.example.demo.service.JoinMeetingService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class JoinMeetingServiceImpl extends ServiceImpl<JoinMeetingMapper, JoinMeeting> implements JoinMeetingService {
    @Override
    public List<String> getMeetingPeopleByMeetingId(String meetingId) {

        LambdaQueryWrapper<JoinMeeting> queryWrapper = new LambdaQueryWrapper<JoinMeeting>()
                .eq(JoinMeeting::getMeetingId,meetingId);
        List<JoinMeeting> list = list(queryWrapper);
        return list.stream().map(JoinMeeting::getUserId).collect(Collectors.toList());
    }
}
